package _31define;

public interface Generator<T> {
    T next();
}
class IntegerGenerator implements Generator<Integer>{
    private int count=0;
    @Override
    public Integer next() {

        return count++;
    }
}
class A{
    public static void main(String[] args) {
        IntegerGenerator integerGenerator = new IntegerGenerator();
        int a=0;
        while (a<10) {
            System.out.println(integerGenerator.next());
            a++;
        }
    }
}